<template>
  <div v-if="Object.keys(goodsDscb).length !== 0">
    <p class="title">{{goodsDscb.title}}</p>
    <div style="margin-top: 8px">
      <span class="newprice">{{goodsDscb.newPrice}}</span>
      <span class="oldprice">{{goodsDscb.oldPrice}}</span>
      <span class="discount">{{goodsDscb.discount}}</span>
    </div>
    <div class="sell-info">
      <span>{{goodsDscb.columns[0]}}</span>
      <span>{{goodsDscb.columns[1]}}</span>
      <span>{{goodsDscb.services[goodsDscb.services.length-1].name}}</span>
    </div>
    <div class="promise">
      <span class="info-service-item" v-for="index in goodsDscb.services.length-1" :key="index">
        <img :src="goodsDscb.services[index-1].icon">
        <span>{{goodsDscb.services[index-1].name}}</span>
      </span>
    </div>
  </div>
</template>

<script>
  export default {
    name: "GoodDescribe",
    props: {
      goodsDscb:{
        type:Object
      }
    }
  }
</script>

<style scoped>
  .title{
    color: #222;
    padding: 5px;
    margin-top: 11px;
  }
  .newprice{
    font-size: 24px;
    color: var(--color-high-text);
    margin-left: 10px;
  }
  .oldprice{
    font-size: 13px;
    margin-left: 10px;
    text-decoration: line-through;
    color: #999;
  }
  .discount{
    color: #fff;
    background-color: var(--color-high-text);
    border-radius: 8px;
    font-size: 16px;
    padding: 3px;
    position: relative;
    margin-left: 10px;
    top: -5px;
  }
  .sell-info{
    display: flex;
    justify-content: space-between;
    padding: 5px;
    font-size: 12px;
    color: #999;
    margin-top: 15px;
    border-bottom: 1px solid rgba(100,100,100,.1);
  }
  .promise{
    line-height: 60px;
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    padding: 5px;
    border-bottom: 3px solid rgba(100,100,100,.1);
  }
  .promise img{
    width: 15px;
    height: 15px;
  }
</style>